package com.yun.algorithm.backtracking;

import java.util.LinkedList;

/**
 * backtracking 回溯
 * 递归
 */
public class Backtracking {
    public static void main(String[] args) {
        rec(1,new LinkedList<>());
    }

    private static void rec(int n, LinkedList<String> list) {
        if(n==3){
            return;
        }
        System.out.println("before:"+list);
        list.push("a");
        rec(n+1,list);
        System.out.println("after:"+list);
    }
}
